package com.alstudio.ui.module.setting;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.alstudio.R;
import com.alstudio.ui.base.TitleBarActivity;
import com.alstudio.ui.module.userguide.UserGuideActivity;
import com.alstudio.utils.distributor.versioncheck.VersionManager;

public class MainSettingActivity extends TitleBarActivity {

	private final String TAG = "MainSettingActivity";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setupView(this, TAG);
		setViewClickListener();
	}

	@Override
	protected void setupView(Context context, String name) {
		// TODO Auto-generated method stub
		super.setupView(context, name);
		setTitleBarContentView(R.layout.main_setting_layout);
		setLeftButtonBackground(R.drawable.title_bar_back_button_selector);
		setCenterTextViewMessage(R.string.TxtSystemSettingTitle);
		hideRightButton(true);
		setCenterTextViewMessage(R.string.TxtMainSettingTitle);
	}

	@Override
	protected void setViewClickListener() {
		// TODO Auto-generated method stub
		findViewById(R.id.system_setting_item).setOnClickListener(this);
		findViewById(R.id.feedback_item).setOnClickListener(this);
		findViewById(R.id.user_guide_item).setOnClickListener(this);
		findViewById(R.id.check_update_item).setOnClickListener(this);
		findViewById(R.id.about_item).setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		Intent i = new Intent();
		switch (v.getId()) {
		case R.id.system_setting_item:
			i.setClass(this, SystemSettingActivity.class);
			startActivity(i);
			break;
		case R.id.user_guide_item:
			i.setClass(this, UserGuideActivity.class);
			startActivity(i);
			break;
		case R.id.feedback_item:
			i.setClass(this, FeedBackActivity.class);
			startActivity(i);
			break;
		case R.id.check_update_item:
			VersionManager.getInstance().checkNewVersion("V1.0.0");
			break;
		case R.id.about_item:
			i.setClass(this, AboutActivity.class);
			startActivity(i);
			break;
		}
	}

	@Override
	protected void initData() {
		// TODO Auto-generated method stub
		
	}

}
